(C) 1996 AROS - The Amiga Replacement OS


NAME
#include <proto/dos.h>
LONG SplitName()
SYNOPSIS
STRPTR name
ULONG seperator
STRPTR buf
LONG oldpos
LONG size

LOCATION
In DOSBase at offset 69
FUNCTION
Split a path into parts at the position of seperator.

INPUTS
name
Split this path
seperator
Split it at this seperator
buf
Copy the current part into this buffer
oldpos
Begin at this place with the search for seperator. If you call this function for the first time, set it to 0.
size
The size of the buffer. If the current part of the
size
1, only size-1 bytes will be copied.
RESULT
The next position to continue for the next part or -1 if there is no seperator after name+oldpos.

NOTES
EXAMPLE
#include 
#include 

#include 

int main (int argc, char ** argv)
{
    LONG pos;
    UBYTE buffer[256];

    if (argc < 3)
    {
	fprintf (stderr, "Usage: %s  \n", argv[0]);
	return RETURN_ERROR;
    }

    pos=0;

    do
    {
	pos = SplitName (argv[1], *(argv[2]), buffer, pos, sizeof(buffer));

	printf ("pos = %3ld  buffer = \"%s\"\n", pos, buffer);
    }
    while (pos != -1);

    return RETURN_OK;
}

BUGS
SEE ALSO
INTERNALS
HISTORY
04.03.1997 digulla
Filled in code
27.01.1997 ldp
Polish
09.12.1996 aros
Added empty templates for all missing functions

Moved #include's into first column